package com.lepu.app.fun.grow;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.core.lib.application.BaseFragmentActivity;
import com.eyzhs.app.R;
import com.lepu.app.widget.CustomTopBarNew;
import com.lepu.app.widget.CustomTopBarNew.OnTopbarNewLeftLayoutListener;

public class GrowHomeShareActivity extends BaseFragmentActivity implements
		OnTopbarNewLeftLayoutListener {

	/*
	 * 网络请求，可以实现 AsyncRequest 具体例子，可以参考TestActivityMain
	 */
	private static final int MSG_TEST_SUCCESS = 10;
	private static final int MSG_TEST_FAIL = 11;

	private static GrowHomeShareActivity mInstance = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.grow_home_share_activity);

		mInstance = this;
		init();
	}

	@Override
	public void onDestroy() {
		super.onDestroy();

		mInstance = null;
	}

	/**
	 * 添加页面动画，需要重写这个方法，
	 */
	@Override
	public void onBackPressed() {
		finish(true);
	}

	/**
	 * ' 获取页面的单实例
	 */
	public static GrowHomeShareActivity getInstance() {
		return mInstance;
	}

	/**
	 * 初始化方法
	 */
	private void init() {
		// topbar
		CustomTopBarNew topbar = (CustomTopBarNew) findViewById(R.id.topbar);
		topbar.setTopbarTitle("家庭共享");
		topbar.setonTopbarNewLeftLayoutListener(this);
	}

	@SuppressLint("HandlerLeak")
	public Handler mHandler = new Handler() {
		public void handleMessage(Message msg) {

			switch (msg.what) {
			case MSG_TEST_SUCCESS:

				break;
			case MSG_TEST_FAIL:
				break;

			default:
				break;
			}
		};
	};

	@Override
	public void onTopbarLeftLayoutSelected() {
		finish(true);
	}

}
